<?php

namespace app\myr\controller;
use app\wechat\service\JwtService;
use Decimal\Decimal;
use think\admin\Controller;
use think\Request;
use think\Db;
use think\Validate;
use app\myr\model\Jxcun as CangkuModel;
use think\admin\helper\QueryHelper;


/**
 * 经销商库存
 */
class Jkucun extends Controller
{
     
    /**
     * 列表
     * @auth true  # 表示需要验证权限
     * @menu true  # 添加系统菜单节点
     * @login true # 强制登录才可访问
     */
    public function index(){
       CangkuModel::mQuery()->layTable(function () {
            $this->title = '经销商库存管理';
        }, static function (QueryHelper $query) {
            $query->like("jxs_code,is_send,boxcode,ProductCD,ProductName,sncode");
        });
    }
    
    protected function _index_page_filter(&$data)
    {
        foreach ($data as &$vo) {
            if($vo["is_send"] == 0){
                $vo["is_send"]="在库";
            }else if($vo["is_send"] == 1){
                $vo["is_send"]="已下发";
            }else if($vo["is_send"] == 2){
                $vo["is_send"]="已退货";
            }
        }
    }
}